package com.fanhang.samples.spring.rmi.client.utils;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.fanhang.samples.spring.rmi.api.entity.Subject;
import com.fanhang.samples.spring.rmi.api.service.DemoService;
import com.fanhang.samples.spring.rmi.api.service.StudentService;

public class HttpInvokerClient {

	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("spring-rmi-client.xml");
//		DemoService service = (DemoService) context.getBean("demoServiceProxy");
//		String result = service.hello("haha");
//		System.out.println(result);
		
		StudentService studentService = (StudentService) context.getBean("studentServiceProxy");
		Subject subject = new Subject();
		subject.setCode("math");
		subject.setName("数学");
		
		String rs = studentService.exam(subject);
		System.out.println(rs);
	}

}
